import java.util.Vector;
import java.util.Iterator;

public class HelloWorld {
	public static void main(String[] args) {
		Vector<String> words = new Vector<String>();
		words.add(".");
		words.add("World");
		words.add("Hello");
		
		// Print the words out using iterators
		// Pre-Java 5.0 way.
		Iterator<String> it = words.iterator();
		while(it.hasNext()) {
			System.out.print(it.next() + " ");
		}
		System.out.println();
		
		// Since Java 5.0, there is special syntax support for
		// Iterable objects
		for(String word : words)
			System.out.print(word + " ");
		System.out.println();
		
		// Let's reverse the vector of words
		for(int i=words.size()-1; i >= 0; i --)
			System.out.print(words.get(i) + " ");
		System.out.println();
	}
}
